﻿
Namespace LightSwitchApplication

    Public Class Application
        Private Sub Application_Initialize()
            Me.Details.ClientTimeout = 21600
        End Sub

      
#Region "Admin Permission Screens"

        Private Sub CustomersListDetail_CanRun(ByRef result As Boolean)
            ' Set result to the desired field value
            If Application.Current.User.HasPermission(Permissions.SiteAdministrator) Then
                result = True
            Else
                result = False
            End If
        End Sub

        Private Sub LocationsChanges_CanRun(ByRef result As Boolean)
            ' Set result to the desired field value
            If Application.Current.User.HasPermission(Permissions.SiteAdministrator) Then
                result = True
            Else
                result = False
            End If

        End Sub

        Private Sub LocationsListDetail_CanRun(ByRef result As Boolean)
            ' Set result to the desired field value
            If Application.Current.User.HasPermission(Permissions.SiteAdministrator) Then
                result = True
            Else
                result = False
            End If

        End Sub
#End Region


        Private Sub salesCustomerListByUsername_CanRun(ByRef result As Boolean)
            ' Set result to the desired field value
            If Application.Current.User.IsInRole("Sales") Then
                result = True
            Else
                result = False
            End If
        End Sub

        Private Sub salesLocationsByCustomer_CanRun(ByRef result As Boolean)
            ' Set result to the desired field value
            If Application.Current.User.IsInRole("Sales") Then
                result = True
            Else
                result = False
            End If
        End Sub
    End Class

End Namespace
